var form = $("#roleFormAdd");
$(function () {
    $("#addRoleSubmit").click(function () {
        $.post('/sso/admin/role/edit',form.serialize(),function(data,status) {
            if(data.status == 200){
                parent.layer.msg("编辑角色成功");
                var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
                parent.layer.close(index); //再执行关闭
            }else{
                parent.layer.msg("编辑失败请重试");
            }
        });
    });
    form.validate({
        errorPlacement: function (error, element) {
            element.before(error);
        },
        rules: {
        }
    });
});